
CREATE TABLE EMPLOYEES
(
  EMPLOYEEID       INTEGER                      NOT NULL,
  LASTNAME         VARCHAR2(20 BYTE)            NOT NULL,
  FIRSTNAME        VARCHAR2(10 BYTE)            NOT NULL,
  TITLE            VARCHAR2(30 BYTE),
  TITLEOFCOURTESY  VARCHAR2(25 BYTE),
  BIRTHDATE        DATE,
  HIREDATE         DATE,
  ADDRESS          VARCHAR2(60 BYTE),
  CITY             VARCHAR2(15 BYTE),
  REGION           VARCHAR2(15 BYTE),
  POSTALCODE       VARCHAR2(10 BYTE),
  COUNTRY          VARCHAR2(15 BYTE),
  HOMEPHONE        VARCHAR2(24 BYTE),
  EXTENSION        VARCHAR2(4 BYTE),
  REPORTSTO        INTEGER,
  AGE              INTEGER
)
TABLESPACE USERS
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          64K
            MINEXTENTS       1
            MAXEXTENTS       2147483645
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
           );


CREATE UNIQUE INDEX PK_EMPLOYEEID ON EMPLOYEES
(EMPLOYEEID)
TABLESPACE USERS
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          64K
            MINEXTENTS       1
            MAXEXTENTS       2147483645
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
           );


ALTER TABLE EMPLOYEES ADD (
  CONSTRAINT PK_EMPLOYEEID
 PRIMARY KEY
 (EMPLOYEEID)
    USING INDEX 
    TABLESPACE USERS
    PCTFREE    10
    INITRANS   2
    MAXTRANS   255
    STORAGE    (
                INITIAL          64K
                MINEXTENTS       1
                MAXEXTENTS       2147483645
                PCTINCREASE      0
               ));


ALTER TABLE EMPLOYEES ADD (
  CONSTRAINT FK_EMPLOYEES_EMPLOYEEID 
 FOREIGN KEY (REPORTSTO) 
 REFERENCES EMPLOYEES (EMPLOYEEID));


